package com.base.cn.platform.os.service.course.qa.qatag;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.course.CourseBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * @author LIZHIPENG
 * @since 2018/4/17
 */
@FeignClient(name= CourseBaseService.appName, configuration = FeignAuthConfig.class)
public interface QaTagService extends CourseBaseService {

    /**
     * 查询标签数量
     * @return 标签数量
     */
    @RequestMapping(contextPath + "/tagCount")
    BigDecimal count();

    /**
     * 查询标签列表(分页)
     * @param currentPage 页码
     * @param qaTag 查询条件
     * @return
     */
    @RequestMapping(contextPath + "/queryQaTagListPage")
    Map<String, Object> queryQaTagListPage(@RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                           @RequestBody Map<String, Object> qaTag);

    /**
     * 查询标签列表(不分页)
     * @param qaTag 查询条件
     * @return
     */
    @RequestMapping(contextPath + "/queryQaTagList")
    List<Map<String, Object>> queryQaTagList(@RequestBody Map<String, Object> qaTag);

    /**
     * 保存问答标签
     * @param qaTag
     * @return
     */
    @RequestMapping(contextPath + "/saveQaTag")
    Map<String, Object> saveQaTag(@RequestBody Map<String, Object> qaTag);

    /**
     * 批量修改标签
     * @param tagIds 标签ID串
     * @param status 状态
     * @return
     */
    @RequestMapping(contextPath + "/updateQaTag")
    Map<String, Object> updateQaTag(@RequestParam("tagIds") String tagIds,
                                    @RequestParam("status") int status);
}
